fix(app): process first CLI TUI input#280
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: ProverCoderAI#274
Working session summaryImplemented and finalized PR #280: #280 Fixed the CLI TUI first-input bug by removing the cold-start swallow behavior and making fresh menu snapshots start with active input handling. Updated regression coverage in menu-input-handler.test.ts, with the implementation change in menu-input-handler.ts and menu-state.ts. Verification:
SOURCE: n/a This summary was automatically extracted from the AI working session output. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
📊 Context and tokens usage:
Total: (272.7K + 16.2M cached) input tokens, 29.9K output tokens, $20.312756 cost 🤖 Models used:
📎 Log file uploaded as Repository (44390KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
|
тут проблема была в том что он не загружал проекты хотя через browser версию всё работало |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR fixes CLI TUI startup behavior by changing the menu initialization from "cold" to "active" state with ChangesMenu input flow
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/app/src/docker-git/menu-state.ts (1)
35-44: ⚡ Quick winNormalize the traceability marker to
QUOTE(ТЗ)(orn/a).The new block uses
QUOTE(ISSUE); the repo format requiresQUOTE(ТЗ)for consistency.Suggested patch
-// QUOTE(ISSUE): "Почему-то CLI TUI не работает" +// QUOTE(ТЗ): "Почему-то CLI TUI не работает"As per coding guidelines: “Functional comments must include: CHANGE, WHY, QUOTE(ТЗ) or n/a, REF, SOURCE or n/a, FORMAT THEOREM, PURITY (CORE|SHELL), EFFECT signature for SHELL functions, INVARIANT, and COMPLEXITY.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/app/src/docker-git/menu-state.ts` around lines 35 - 44, Replace the traceability marker "QUOTE(ISSUE)" in the top comment block with the repo-standard "QUOTE(ТЗ)" (or "n/a") so the block that starts with CHANGE/WHY/QUOTE/... conforms to the required metadata format; locate the comment containing "QUOTE(ISSUE)" in menu-state.ts and update only that token to "QUOTE(ТЗ)" (or "n/a") ensuring all other tags (CHANGE, WHY, REF, SOURCE, FORMAT THEOREM, PURITY, EFFECT, INVARIANT, COMPLEXITY) remain unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/app/src/docker-git/menu-state.ts`:
- Around line 35-44: Replace the traceability marker "QUOTE(ISSUE)" in the top
comment block with the repo-standard "QUOTE(ТЗ)" (or "n/a") so the block that
starts with CHANGE/WHY/QUOTE/... conforms to the required metadata format;
locate the comment containing "QUOTE(ISSUE)" in menu-state.ts and update only
that token to "QUOTE(ТЗ)" (or "n/a") ensuring all other tags (CHANGE, WHY, REF,
SOURCE, FORMAT THEOREM, PURITY, EFFECT, INVARIANT, COMPLEXITY) remain unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 5dee33db-6bd9-4220-a98b-982979ff7932
📒 Files selected for processing (3)
packages/app/src/docker-git/menu-input-handler.tspackages/app/src/docker-git/menu-state.tspackages/app/tests/docker-git/menu-input-handler.test.ts
Summary
Fixes #274: the CLI TUI could appear ready while the first real user inputs were still ignored.
Root cause
A fresh menu snapshot started with
inputStage: "cold"andskipInputs: 2. After the readiness/time gate had already finished, the Gridland input boundary could still consume two valid user key events, and the pure menu input handler also intentionally dropped the first single-character alias, arrow, or Enter event while moving fromcoldtoactive.That violates the TUI liveness invariant: once the rendered menu is ready and not busy, a valid user key should be processed without requiring dummy keypresses.
Fix
inputStage: "active"andskipInputs: 0.restoreMenuAfterInteractiveEffect(... skipInputs: 2)..gitkeepthat was only used to bootstrap this PR branch.Mathematical guarantees
forall key in ValidMenuInput: ready(menu) and not busy(menu) and not sshActive(menu) -> processed(key).ready/ignoreUntil), while the pure input routing layer no longer discards valid domain events.Tests
bunx vitest run packages/app/tests/docker-git/menu-input-handler.test.tsbun run --cwd packages/app lint:testsbun run --cwd packages/app lintbun run --cwd packages/app lint:effectbun run --cwd packages/app typecheckbun run checkEnvironment note:
bun run --cwd packages/app testand full directbunx vitest runwere attempted locally, but this runner terminated them with SIGTERM before a Vitest assertion failure was emitted. The focused regression test and static/type checks above passed; CI should run the complete matrix on the pushed SHA.